FROM ubuntu:18.04
LABEL maintainer="james@example.com"
ENV REFRESHED_AT 2020-07-08
RUN sed -i "s@http://.*archive.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list
RUN sed -i "s@http://.*security.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list
RUN apt-get -y update && apt-get -y install ruby ruby-dev build-essential redis-tools
RUN gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
RUN gem install --no-document sinatra json redis

RUN mkdir -p /opt/webapp

EXPOSE 4567

CMD [ "/opt/webapp/bin/webapp" ]
